﻿namespace SLNGP.Core.Genes
{
    /// <summary>
    /// Contains a list of all builtin gene defitnions. 
    /// </summary>
    public static class Genes
    {
        static Genes()
        {
            MathFunctions = new MathFunctions();
        }

        /// <summary>
        /// contains a list of all built-in math function genes.
        /// </summary>
        public static MathFunctions MathFunctions { get; set; }

        /// <summary>
        /// Initializes a new Variable Gene Defintion. 
        /// </summary>
        /// <typeparam name="TVariableType">The Variable type.</typeparam>
        /// <param name="name">The variable name.</param>
        /// <returns>A Gene Definition.</returns>
        public static IGeneDefinition Variable<TVariableType>(string name)
        {
            return new VariableGeneDefinition<TVariableType>(name);
        }
        
        /// <summary>
        /// Initialized a new Constant Gene Defintion.
        /// </summary>
        /// <typeparam name="TContantType"></typeparam>
        /// <param name="type"></param>
        /// <returns></returns>
        public static IGeneDefinition Constant<TContantType>(TContantType constant)
        {
            return new ConstantGeneDefinition<TContantType>(constant);
        }
    }
}